#include "eigen/relu.h"
#include "log.h"

namespace  ldl_eigen
{
void ReLU::forward()
{
    m_output = (*m_ptr_input).array().max(0);
}

void ReLU::backward()
{
    m_input_gradient = ((*m_ptr_input).array() > 0.0f).select((*m_ptr_output_gradient), 0.0f);
}

}